<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ page import="java.util.ArrayList, edu.student.models.*" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<br>
<br>
<body>

<table border="1" align="center">
<tr> 
    <th><h2>Name</h2></th>
	<s:if test="%{table=='announcement' || table=='news'}">
    <th><h2>Interests</h2></th>
    <th><h2>Duration</h2></th>
    </s:if>
    <s:if test="%{table=='semester'}">
    <th><h2>Duration</h2></th>
    </s:if>
    <s:if test="%{table=='subject'}">
    <th><h2>Subject Code</h2></th>
    <th><h2>Faculty</h2></th>
    </s:if>
    <th><h2>Is Current?</h2></th>
    <th><h2>Modify?</h2></th>
    <th><h2>Delete?</h2></th>
</tr>
<s:iterator value="allValues">
<s:hidden name="table" value = "<s:property value='table'/>"/>
<tr>
<td><h3><s:property value="name"/> </h3></td>
<s:if test="%{table=='announcement' || table=='news'}">
<td><h3><s:property value="interest"/> </h3></td>
<td><h3><s:property value="duration"/> </h3></td>
</s:if>
<s:if test="%{table=='semester'}">
<td><h3><s:property value="duration"/> </h3></td>
</s:if>
<s:if test="%{table=='subject'}">
<td><h3><s:property value="subject_code"/> </h3></td>
<td><h3><s:property value="faculty"/> </h3></td>
</s:if>
<td><h3><center><s:property value="is_current"/></center></h3></td>
<s:if test="%{table!='Role' && table!='WorkflowPoint'}">
<td>
<s:url id="modify" action="modify_lookup">
<s:param name="lookup_id" value="id"/>
<s:param name="table" value="table"/>
</s:url> 
<h3><s:a href="%{modify}" onclick="display_alert()">Modify</s:a></h3>
</td>
<td>
<s:url id="delete" action="delete_lookup">
<s:param name="lookup_id" value="id"/>
</s:url>
<h3><s:a href="%{delete}">Delete</s:a></h3> </td></s:if>
</tr>
</s:iterator>
</table>
<br>
<table>
<tr>
<s:if test="%{table!='User'}">
<tr><td>
<h2 align="left"><a href="add_lookup" id="mysubmit">Add a New Value</a></h2>
</td>
</tr></s:if>
<td><h2 align="left"><a href="back" id="mysubmit">Return to LookupList</a></h2></td>
</tr>
</table>
</body>
</html>